package com.decade.qiyeshapan.entity;

import java.io.Serializable;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

public class User implements Serializable {
    private String userId;
    private String gameId;
    private String username;
    private int currentProgress;
    private String socketId;
    private boolean isReady;
    private int taskProgress;
    private int totalAdInvestment;
    private int cash;          // 现金
    private int accountsReceivable; // 应收账款
    private int shortTermLoan; // 短期贷款
    private int longTermLoan;  // 长期贷款

    public User() {
    }

    @JsonCreator
    public User(@JsonProperty("gameId") String gameId, 
                @JsonProperty("username") String username) {
        this.userId = UUID.randomUUID().toString();
        this.gameId = gameId;
        this.username = username;
        this.currentProgress = 0;
        this.socketId = "";
        this.cash = 100;
        this.accountsReceivable = 0;
        this.shortTermLoan = 0;
        this.longTermLoan = 40;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getGameId() {
        return gameId;
    }

    public void setGameId(String gameId) {
        this.gameId = gameId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getCurrentProgress() {
        return currentProgress;
    }

    public void setCurrentProgress(int currentProgress) {
        this.currentProgress = currentProgress;
    }

    public String getSocketId() {
        return socketId;
    }

    public void setSocketId(String socketId) {
        this.socketId = socketId;
    }

    public boolean isReady() {
        return isReady;
    }

    public void setReady(boolean ready) {
        isReady = ready;
    }

    public void setTaskProgress(int taskProgress) {
        this.taskProgress = taskProgress;
    }

    public int getTaskProgress() {
        return taskProgress;
    }

    public int getTotalAdInvestment() {
        return totalAdInvestment;
    }

    public void setTotalAdInvestment(int totalAdInvestment) {
        this.totalAdInvestment = totalAdInvestment;
    }

    public int getCash() {
        return cash;
    }

    public void setCash(int cash) {
        this.cash = cash;
    }

    public int getAccountsReceivable() {
        return accountsReceivable;
    }

    public void setAccountsReceivable(int accountsReceivable) {
        this.accountsReceivable = accountsReceivable;
    }

    public int getShortTermLoan() {
        return shortTermLoan;
    }

    public void setShortTermLoan(int shortTermLoan) {
        this.shortTermLoan = shortTermLoan;
    }

    public int getLongTermLoan() {
        return longTermLoan;
    }

    public void setLongTermLoan(int longTermLoan) {
        this.longTermLoan = longTermLoan;
    }
} 